package com.most.api;

import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;

import java.util.List;

@Component
public class UserClientFallbackFactory implements FallbackFactory<UserClient> {
    @Override
    public UserClient create(Throwable throwable) {
        return new UserClient() {
            @Override
            public String getUser() {
                return "用户模块异常！";
            }

            @Override
            public UserVO findOneByUserName(String username) {
                return null;
            }

            @Override
            public List<String> getPermissionsById(Long id) {
                return null;
            }
        };
    }
}